/*
 * tarm_iic.h
 *
 *  Created on: 2019年12月10日
 *      Author: tinnu
 */

#ifndef MIDDLEWARE_TARM_CTIMER_H_
#define MIDDLEWARE_TARM_CTIMER_H_


#include "fsl_ctimer.h"
#include "peripherals.h"

void CTIMER0_Init(void);
void CTIMER0_InitXUs(uint32_t inpu_timeUs);
void CTIMER0_Reset(void);
void CTIMER0_ChangeMatchValue(uint32_t inpu_value);

void CTIMER1_Init(void);
void CTIMER1_InitXUs(uint32_t inpu_timeUs);
void CTIMER1_Reset(void);
void CTIMER1_ChangeMatchValue(uint32_t inpu_value);

//timer to counter the debug speed
void CTIMER2_Init(void);

//callback
extern void CTIMER0_IntMa0CallBack(uint32_t flags);
extern void CTIMER1_IntMa0CallBack(uint32_t flags);

//对hardware接口
void Time0CallBack(void);
void Time1CallBack(void);

void SysTick_Handler(void);
void SysTick_DelayTicks(uint32_t n);
void delay_ms(uint32_t n);
void delay_us(uint32_t n);

#endif /* MIDDLEWARE_TARM_IIC_H_ */
